home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 4 / BBS in a Box - Macintosh - Volume IV (January 1992) (BBS in a Box).iso / Files / Prog / M / Modem Windowing < prev    next >
Encoding:
Text File  |  1989-03-26  |  30.0 KB  |  341 lines  |  [TEXT/MACA]

  1. Modem Windowing and Mail Retrieval Standard
  2. JWindows and JScript Version 1.01 - March 24, 1989
  3. By: John R.H. Penner (GEnie: J.PENNER)
  4.  
  5.     One paragraph on JWindows Background:  I am proposing a new standard for telecomunicators everywhere.  It is called JWindows, and JScript.  I am doing so out of frusteration with the archiac command line interface telecomunicators have had to put up with for years.  We have 2 Megabyte machines with 16.3 Million Colors, and 80 Megabyte Hard Disks, with Windowing Software Built in ROM if you have a macintosh, or OS/2 and Microsoft Windows if you have a PC.  But when it comes to phoning up your local BBS, or GEnie, or CompuServe, you get stuck with this stupid old command line interface, that's text only, and monospaced, and very unelegant - This is riduculous, why are we choosing to live in the stone age!?!?  Also it is a real pain for Telecommunications scripts to go and retrieve mail from your favorite information service, because they have to contort through menus built for humans, not computers, and every place you phone up has a different way of accessing some pretty standard features:  Entering in your name and password, Reading Mail Addressed to You, and Up/Downloading a File.  So, enough talk, let's get to the proposal...
  6.  
  7.  
  8. This proposal comes in two parts:
  9.  
  10.     1.  This first part is the Windowing standard called JWindows, it allows Macintoshes, and PC's the ability to send Windows, Buttons, Menus, and Some Graphics over the phone to any other Mac or PC which has a terminal program supporting this simple protocol.
  11.  
  12.     2.  The Second part of this proposal deals with a standard form for computer scripts to automatically access a BBS, or information service to do such basic operations like: Logging On, Logging Off, Retrieving Mail Sent to You, Reading New Bulletins, and Up/Downloading a File.
  13.  
  14.  
  15.  
  16.     Part I - Windowing Standard for Telecommunications Programs
  17.     ===========================================================
  18.  
  19. There are two ends to this, the terminal that recieves the commands (typically Joe User Phoning up a service like GEnie, or his favorite BBS) will be called the Host, and the BBS Program, or Information Service (like GEnie, hint hint) will be called the Sender.  Now this Standard aims to be fairly straightforward in it's approach,  When the Sender sends a String (under the Heading "String") the Host will respond by doing the appropriate action on the screen.  The chart below details what "Strings" do what:
  20. By the way, if any of these escape code interfere with VT100 escape codes, then maybe we can change all the number 27's in the Strings below to 19's (which is now the useless DC3).  Or some other relatively unused ascii character.
  21.  
  22. Note, all coordinates are given in pixels, and start at 0,0 in the top left corner of the screen, for a rectangle, the coordinates will be given as: a,b,c,d
  23. So, a will be the left side of the rectangle (sometimes called X1), and b will be the Top of the Rectangle (sometimes called Y1), and c will be the right side of the rectangle (sometimes called X2), and d will be the bottom of the rectangle (sometimes called Y2).  Does this sound so complicated???  Keep in mind, a lot of these commands could be VERY easily implemented by someone writing a simple terminal program in Microsoft QuickBasic.
  24.  
  25.  
  26. Command    String
  27. _______    __________________________
  28.  
  29. WINDOW    27,01,id,X,Y,Z,a,b,c,d
  30.  
  31. Makes a window
  32. - id, is of course the id number of the window the Sender wishes to create.
  33. - If X=1 then create a window if the window already is open, then ignore the command.
  34. - If X=0 then close the window, If Y=1 then Select the window, if Y=0 then Deselect the window.
  35. - Z is the Window type with valid numbers being 1,2,3,4 which corespond to the 4 macintosh window types, and would correspond to similiar window types in MS-Windows.
  36. - a,b,c,d are of course the coordinates of the window.
  37. - eg. If the Sender were to send the Host the bytes:  27, 12, 1, 1, 2, 20, 20, 100, 100 the host would create a Window of type 2, with id=12, Selected, and with boundaries of (20,20)-(100,100).
  38.  
  39.  
  40. BUTTON    27,02,id,X,Y,Z,a,b,c,d,n,TEXT
  41.  
  42. Makes a Button
  43. - id is of course the id number of the button being created.
  44. - X is the hilite of the button, if X=0, then the button is dimmed out, and inactive, if X=1 then the button looks like a normal unhilited button, and if X=2 then the Button is hilited (checked off, has an X through it, Inverts, or however you want your buttons hilite)
  45. - Y is the Button Type.  Y=1 is a simple push button (like the kind where you put the word "OK" into) Y=2 is a Check Box, it is square, and gets an X through it when hilited. Y=3 is a Radio Button, it is a small circle, and gets a polka dot in it when hi-lited.
  46. - Z is the creator flag, this is not complicated, if Z=0 then the button is removed, and the other arguments are ignored, if Z=1 then the button is created, if the button already exists, the current button is replaced by this new information.
  47. - a,b,c,d are the button coordinates of course (it's active area, ie., the area that when clicked in, will send a button clicked message for that button, and for Check Boxes, and Radio Buttons, they are located in the Top Left Corner of this area, if it is bigger than they are, and if it's a normal push button, this area is the size of the whole button)
  48. - n is the number of characters of text that will follow
  49. - TEXT is the text displayed in the button, and it is n bytes long
  50. - eg. if the Sender sent the host the string of bytes:  27, 02, 7, 1, 1, 10, 10, 50, 30, 2, "OK", then the Host would make a Push Button of id = 7 , it would be enabled, with 2 characters of text ("OK" is two characters long) with boundaries of (10,10)-(50,30)
  51.  
  52.  
  53. MENU        27,03,id,item,state,n,TEXT
  54.  
  55. Inserts a Menu Item, or Creates a new Menu
  56. - id is the number assigned to the menu bar selection (if you have five menus across the top of your menubar, the third menu has a id of 3)
  57. - item is the number assigned to the menu item underneath the menu bar, it specifies an item in the menu.  If item id=0 then it specifies the entire menu.
  58. - state is the state of the menu.  state=0 disables the menu, or menu item, state=1 enables the menu, or menu item, state=2 enables the menu, or menu item, and puts a checkmark beside it.
  59. - n is the number of characters following in TEXT
  60. - TEXT is the text, or the words of the menu item.  If the text is a single character "-" then the menu item will be one of those lines in the middle of menus you so often see
  61. - note: if state=0 and n=0 and TEXT="" then the menuitem is removed
  62. - eg. If host is sent the string of bytes: 27,3,1,0,1,4,"File", and then the string of bytes:  27,3,1,1,1,5,"Hello", a menu called "File" would appear in the menubar (and it would be menu 1) and when you pulled down the menu, it would have one item in it called "Hello"
  63.  
  64.  
  65. EditField    27,04,id,Z,a,b,c,d,X,n1,n2,TEXT
  66.  
  67. Creates an Edit Field
  68. - id is the id number of the Edit Field
  69. - Z is the creator flag.  If Z=0 then the edit field is removed, and the other arguments are ignored, if Z=1 then the edit field is created, or if one already exists, it is remade with this new information.
  70. - a,b,c,d are the coordinates of the edit field
  71. - X is the alignment of the edit field, if X=1 then the text is left justified, if X=2 then the text is centered, if X=3 then the text is right justified.
  72. - n1 amd n2 is the number of characters following in TEXT.  n1 if the MSB, and n2 is the LSB.  eg, if TEXT is "Hi there folks." well we would find n be counting how many letters there are there, "Hi there folks." has 15 characters in it, so n=15.
  73. - TEXT is the default text displayed in the edit field
  74. - eg.  If the host were sent 27,04,03,1,20,30,100,50,2,15,"Hi there folks." then the host would create an edit field of id=3, with centered text "Hi there folks." with boundaries of (20,30)-(100,50)
  75.  
  76.  
  77. IconBut    27,05,id,X,Y,Z,n,TEXT,IconData (128bytes)
  78.  
  79. This is for the ambitious programers out there, if you feel you would like to send icons over the modem which act just like buttons when clicked on, well then you can try to program this, but this is an optional command, as it is not simple to program like the rest of the commands given here.  The parameters are just like for BUTTON, with 128 bytes icon data appended to it.  (128 bytes will give you a nice 32 x 32 bit icon)
  80.  
  81.  
  82. ScrollBox    27,06,id,Z,a,b,c,d,n,ItemList
  83.  
  84. Creates a scroll Box with a whole bunch of items in it.  (Like when you go to open a file, you get a scrollable list of file names)  This command is also optional, because it is also a bit harder for the average programmer to easily put in his/her program.  But if you write a commercial Telecom Package, I would really ask you to put this one in, because it could be very useful.  (Like for editing messages for example, because the cursor keys, and text reformating would be done locally)
  85. - id is the id number of the scrollbox
  86. - Z=0 removes the scrollbox, and Z=1 creates it
  87. - a,b,c,d are the coordinates of the scroll box
  88. - n is the number of items in ItemList
  89. - ItemList is a list of items to go into the ScrollBox.  Each Item is one line, and is terminated by a Cariage Return (optional Linefeeds will be ignored)
  90. - eg. host is sent 27,06,1,1,10,10,100,100,5,"Hello^Line Two^Line Three^Line Four^Goodbye^"  where the character: ^ is an asc(13) carriage return will create a scrollable box listing those five items.
  91.  
  92.  
  93. *Maybe I should just take time to mention here that if none of these special escape sequences are sent, then text sent to the host will appear at the current cursor position just as text has always appeared in terminal programs.
  94.  
  95.  
  96. MoveTo    27,33,x,y
  97.  
  98. Moves to a given location
  99. - x,y are the coordinates to which the cursor will be moved, subsequent text, or lines drawn using the LINETO command will start at this location
  100. - x,y are given in pixels, and start from 0,0 which is in the top left corner.
  101.  
  102.  
  103. LineTo    27,34,x,y
  104. Draws a line from the current cursor position to coordinates x,y
  105.  
  106.  
  107. Rect        27,34,a,b,c,d
  108. Creates a rectangle with coordinates a,b,c,d
  109. a = Left Side
  110. b = Top
  111. c = Right Side
  112. d = Bottom
  113.  
  114.  
  115. RoundRect    27,35,a,b,c,d
  116. Same as Rect, only the rectangle will have rounded edges.
  117.  
  118.  
  119. Circle    27,35,x,y,radius,Start,End,Aspect
  120. Creates a circle, x,y,radius should be obvious, and are measured in pixels
  121. - Start, and End are the start and end angles in radians.  The range is -2pi through +2pi, these angles allow the Sender to specify where a circle or ellipse begins and ends.
  122. - Aspect is the aspect ratio, the ratio of the x radius to the y radius, Because it is not desireable to send decimal numbers as part of a string.  this number will range from 0 to 255, with 128 producing a perfect circle.
  123.  
  124.  
  125. PenSize    27,36,x,y
  126. This is the size of the pen.  Read up on the quickdraw pen if you don't know what this is.
  127.  
  128. PenPat    27,37,bytes
  129. bytes is 8 bytes that define a penPattern, it is an 8 bit by 8 bit pattern, with byte0 being on top, and byte7 being on bottom, and the MSB is on the Left, and the LSB is on the right.  This allows a pen to be white, or grey or black, or whatever you like.
  130.  
  131.  
  132. PenColor    27,38,c,r,g,b
  133. This is a sneaky command.  Because it will set the color of the pen on both ibm, and Macintosh Systems.  C will be the color you want to show up on an ibm screen with values from 0 - 32, lets say we make c=5 which is red (for sake of arguement) will then we would make r=255, g=0, and b=0, thus the mac will get rgb values, and the ibm will get one of it's own 32 colors, if you wanted to send blue, you would make c=7 (which is blue on the ibm, for sake of arguement) and make r=0, g=0, and b=255, nifty huh?  And you can make up to all of the mac's 16.3 million colors by giving rgb values, and the closest ibm equivilent in c.
  134.  
  135.  
  136. FillColor    27,39,c,r,g,b
  137. This is the same as PenColor, but defines the color of the fill for a circle, rectangle, etc.
  138.  
  139.  
  140. FillPat    27,40,bytes
  141. bytes is 8 bytes that define the FillPattern, the format is the same as for PenPat
  142.  
  143.  
  144. TextFont    27,41,id
  145. id the id of font to use is subsequent display of characters
  146. Since not all computers are macintoshes, (some are PC's) we will rely only on the fact that id=21 is for Times, id=22 is for Helevetica, and id=20 is for Courier, and id=0 is the system font (ussually Chicago) and id=1 will be Application Font, and id=2 will be New York, id=3 is Geneva, id=4 is Monaco, and id=42 will be "IBM Font" with all of the original IBM characters.
  147.  
  148.  
  149. TextSize    27,40,id
  150. id will be the Size of the current font in Points.  it will range from 0 to 255 points, but to be ussable, you will probably want to keep this between 9 and 72 points.
  151.  
  152.  
  153. TextFace    27,41,face
  154. face will define the look of the text, whether it be underlined, or shadowed, or italic, or bold
  155. Simply Add together the values of the attributes you want:
  156.     0  - Plain Text
  157.     1  - Bold
  158.     2  - Italic
  159.     4  - Underlined
  160.     8  - OutLined
  161.     16 - Shadowed
  162.     32 - Condensed (less space between characters)
  163.     64 - Extend (more space between characters)
  164. Thus, face=0 is plain text, face=10 makes it outlined and italic (8+2) and face=1 makes it bold
  165.  
  166.  
  167. CopyMode    27,42,mode
  168. -mode=0 causes whatever is drawn on the screen to replace whatever is behind it.
  169. -mode=1 causes whatever is drawn on the screen to be OR'ed with whatever is behind it.
  170. -mode=2 causes it to be XOR'ed
  171. -mode=3 uses the BIC (Black is Changed) transfer mode
  172.  
  173.  
  174. BMAP        27,43,a,b,c,d,e,n1,n2,n3,n4,x1,x2,x3...xn,CRC1,CRC2
  175. this command allows bitmapped information to be sent to the destination rectangle a,b,c,d, e is the number of bits per pixel, and will typically be set to 1, for black and white bitmaps, n1, n2, n3, n4 are the number of bytes to follow with the leftmost bit of n1 being the MSB, and the rightmost bit n4 being the LSB.  x1, x2, x3, x4 is the data in compressed gif format, and CRC1 (MSB) and CRC2 (LSB) is the modulus CRC check for x1-xn bytes.  This command is included here in anticipation of everyone someday (sigh) using 19.2k modems, so for now, if you send BMAPs, please keep them fairly small, so us users don't have too wait too long, but definitely do include this command, as in the future, it will make for some pretty neat online graphics.  (Once everyone gets up to speed) The description for this command is fuzzy, I think maybe it could be clarified in a discussion on GEnie, or CompuServe, with several knowledgeable people.  This one's up to you...
  176.  
  177.  
  178. Move        27,44,a,b,c,d,x,y
  179. instructs the host computer to move the rect (a,b)-(c,d) to (x,y)
  180. (ie, whatever was at point (a,b) will winds up at (x,y)
  181.  
  182.  
  183. Cut        27,45,a,b,c,d
  184. instructs the host computer to cut out the contents out rect (a,b)-(c,d)
  185.  
  186.  
  187. Copy        27,46,a,b,c,d
  188. instructs the host computer to make a copy of whatever is inside the rect (a,b)-(c,d)
  189.  
  190.  
  191. Paste        27,47,x,y
  192. instructs the host computer to paste whatever is on the clipboard (from a previous cut or copy operation) onto the current window at location (x,y)
  193.  
  194.  
  195. Clear        27,48,a,b,c,d,z
  196. instructs the host computer to clear a specified area of the current window.
  197. -if z=0 then the rect formed by (a,b)-(c,d) will be cleared (but not buttons or menus, or edit fields)
  198. -if z=1 then a,b,c,d will be ignored (but they must be passed as 0 nul arguments) and the whole screen (actually the current window) will be cleared.
  199. -if z=2 then then all windows, buttons, and edit fields will be removed, and one empty window will be left on the screen with coordinates (a,b)-(c,d)
  200.  
  201.  
  202. VisualEffect    27,49,X,a,b,c,d,e,f,g,h
  203. This will do a visual effect (similiar to those in hypercard) to an area on the screen bounded by (a,b)-(c,d)
  204. - X will be the number of the visual effect
  205. - For X=1 the visual effect will be a "Zoom" Effect, where little zoom lines "Zoom" from (a,b)-(c,d) to (e,f)-(g,h)
  206. - For X=2 the visual effect will be a marquee type effect bounded by (a,b)-(c,d).  e,f,g,h are ignored
  207. - For X=3 the visual effect will be a disolve to black bounded by (a,b)-(c,d).  e,f,g,h are ignored
  208. - For X=4 the visual effect will be a disolve to the current FillColor, bounded by the rect (a,b)-(c,d)
  209. - I leave the rest up to general whatever standard the rest of the user community wants to agree upon.
  210.  
  211.  
  212. Speak        27,50,n,TEXT
  213. this will speak through Macintalk the Text contained in TEXT.
  214. n defines how many characters long TEXT will be.
  215.  
  216.  
  217. CopyFrame    27,51,n,a,b,c,d
  218. this will copy an area in a window bounded by the rectangle made by (a,b)-(c,d) into the Hosts internal Frame Buffer, with an id of n.  ie, when the host receives 27,51,3,10,10,100,100  the host will memorize the contents of whatever is framed by (a,b)-(c,d) into Frame 3.  Frame 3 can then be recalled at any time and at any coodinate within a window by using the PutFrame Command.
  219.  
  220. PutFrame    27,52,n,a,b
  221. when the host receives this command, the host will display the contents of Frame n at location (a,b) in the current window.  Using CopyFrame, and PutFrame, animation might be achieved by remotely drawing several pictures on the host, copying them into frames using CopyFrame, and then displaying several frames quickly in succession.
  222.  
  223.  
  224. **** Request Functions ****
  225. These commands, when sent by the Sender, should have the host send back some feedback:
  226.  
  227. ScreenSize    27,65
  228. When the Sender sends 27,65, the host should return a string in the form of:  27,65,x,y,z  where x is the screen width of the host system, y is the screen height of the host system, and z is the height of the menubar of the host system.
  229.  
  230. Version        27,66
  231. When the Sender sends 27,66, the host should return a string in the form of:  27,66,a,b,c,d  where a and b are ascii numberals of the version of JWindows the host is capable of supporting, and c and d will be the decimal.  eg:  for version  12.03 of JWindows, a=1, b=2, c=0, d=3.  Or for version 1.00 of JWindows (this version) a=0, b=1, c=0, d=0.  One more example for the neophytes out there:  for version 34.58, a=3, b=4, c=5, and d=8.  Tu comprende?
  232.  
  233.  
  234. JWindows Running?        27,67,x
  235. When the Host and Sender first connect, the Sender (bbs program, or information service) will send the string 27,67,x repeatedly, to which the Host will send back each time the response string: 27,67,x.
  236. - x will tell the Sender and Host whether JWindow and/or JScript is running.  If X=1 then only JWindows is running.  If X=2 then only JScript is running.  If X=4 then both JWindows, and JScript are running on the Host Computer.
  237. - Once the sender has received the confirming signal at least three times, the Sender can be sure that the Host computer is running JWindows, and can proceed to issue window, and button commands to the host, if no response string (27,67) is returned to the Sender Computer after 5 failed attempts at getting a reply, the Sender computer will assume an old fashioned TTY type terminal program is the host, and will send out the old fashioned command line interface as telecommunicators have had to deal with for years...
  238.  
  239.  
  240. GetEditField    27,68,x
  241. When the Sender sends this string (where x is the number of the edit field the Sender wants to get) the host should send back a string in the form of: 27,67,x,n1,n2,TEXT where x is the number of the edit field being sent from the host to the sender, n1 (MSB) and n2 (LSB) is the number of characters in TEXT, and TEXT is the text of the edit field (this can contain carriage returns to mark the ends of paragraphs).
  242.  
  243.  
  244. **** Host Events ****
  245. The host program is required to send back an ACK (ascii 6) for each command received, or a NAK (ascii 21) if a command didn't make sense.  If the user of the host presses a button, or selects a menu, it must let the Sender know which button, or menu was selected, this is called a "Host Event"...
  246.  
  247.     When a button is clicked on the host computer, the host must send back to the Sender computer a string in the form of 27,02,x  where x is the id number of the button that has been pressed.
  248.  
  249.     When a menu item is selected on the host computer, the host must send back to the Sender computer a string in the form of 27,03,x,y where x is the id number of the menu selected, and y is the id number of the item selected in the menu.  eg:  In our example on making a menu (see the Menu Command) we had a "File" menu with the word "Hello" in it; if hello was selected from the menu, the host would send back:  27,03,1,1   the 27,03 tells the Sender that a Menu Item has been selected.  The first "1" (which is x) is for the "File" menu.  The second "1" (which is y) is for the "Hello".
  250.  
  251. The sender must send an ACK (ascii 6) to the host after recieving one of these "Host Event" messages, or a NAK (ascii 21) if it didn't understand.
  252.  
  253.  
  254. Well that's about it for JWindows, oh, and by the way, there's no reason why a computer couldn't be a Sender and a Host at the same time.  This would allow interactive drawing between two people hooked up with JWindow Compatible Terminal programs (regardless of which computer they were on)  Now for the Script Standard...
  255.  
  256.  
  257.  
  258.     PART II
  259.     =======
  260.  
  261.     JScript:  Finally standard mail retrieval from BBS's and Information services that's easy for a Telecom Script to retrieve
  262. =================================================================
  263.  
  264.  
  265. Quick background:  How many scripts have you written for Red Ryder, Microphone, Procomm, Crosstalk to retrieve mail from BBS's and information services, and for every service you have to start from scratch, and do lots of experimenting, and make costly phone calls, wouldn't it be great if there were one standard for Logging On/Off, Getting Mail/Bullitins, and Up/Downloading Files?  Do a script once, and it works for all BBS's and GEnie too!  Too much to ask?  Not if people start standardizing.  JScipt is intended for unattended access to communications services, like when the user is sleeping.  So I propose a standard...    ;-)
  266.  
  267.     *>=- JScript -=<*
  268.  
  269.  
  270. **** Functions ****
  271.  
  272. Logon        27,129,n,identity$
  273.  
  274. - n should be the number of characters in Identity$
  275. - identity$ is a string of ascii characters unique to each bbs, it should be terminated with a CR (ascii 13) and should be in the form of:Name;Node Number;Phone Number.  Thus Calling a bbs called Towne Crier with phone number 416-646-0263 being Node 148/370 on NetMail, identity$ would be:  "Towne Crier;148/370;416-646-0263"  This format should be followed exactly.  If a service doesn't have a telephone number, or Node Address, the word "NUL" should be used.  Thus, a service such as GEnie would be: "GEnie;nul;nul" as it doesn't have a specific telephone number or node address on FIDO.  Using Identity$, the host can call up the appropriate password, and user Id, and first and last name, and StartUpAction assosociated with that service.  Once a service first uses an Identity$, it should NEVER be changed.  So a user phoning up the service will nevert have to modify his/her procedure files that recognize which service has been logged onto.
  276. When the Sender sends this Logon code, the Host should respond with a string in the form of:  27,129,FName,LName,UserID,Password
  277. each parameter should be terminated with a carriage return (line feeds should be ignored).  Eg:  in response to the Towne Criers logon request of:  27,129,32,"Towne Crier;148/370;416-646-0263", the host would send back: 27,129,John^Penner^nul^Password^
  278. (Where the ^ character would be interpreted as CR (ascii 13)
  279. The Sender would then send an ACK (ascii 6) to acknowledge the receipt of the users name and password.  If the board does not require a user id, the string "NUL" should be used, similiarly if A first and last name are not required, but a user id is required (like on GEnie), then "NUL" should be used.  Thus for GEnie, the host would send back:  27,129,nul^nul^XTH9999^Password^
  280. If there is a problem with the returned name and password, the host will send back a NAK (ascii 21) If after three attempts, the host computer doesn't supply a proper name and password, the Sender Computer will disconnect.
  281.     If the first name "New" and the last name "User" is used,  then Sender will respond with an ACK, and standby to receive a Message from the Host.  If New Users are not allowed, a window will pop up (using JWindow protocol) informing the host, and then log him/her off.  Or you could do whatever you wanted through JWindows...
  282.     If after a successful name has been sent back to the Sender Computer, and the Sender has sent back an ACK (ascii 6), the Sender computer will send NOTHING!!!!!  IT SHOULD WAIT FOR THE HOST COMPUTER TO REQUEST AN ACTION!!!  THE SENDER COMPUTER SHOULD NOT SEND NEWSFLASHES, OR BULLETINS TO THE HOST, BUT SHOULD INSTEAD WAIT FOR THE HOST TO REQUEST THEM!!!  The host computer can send one of the following commands...
  283.  
  284. LogOff        27,130,1
  285. This command is sent from the host to the Sender when the host wishes to terminate a session.  The Sender will respond with a string:  27,130,1, to confirm the intent to logoff, then host will reply with 27,130,2, after which the Sender Computer will disconnect the Host computer.
  286.  
  287. NewBullitin Request        27,131
  288. The Host should send this to the Sender Computer right after logging on.  The host should then send back a bullitin if, and only if something new, and critical to the user using the board has happend.  It will be in the form of:  27,131,n1,n2,TEXT
  289. where n1 is the MSB, and n2 is the LSB, telling how many bytes of text there are to be received by the host computer in TEXT.  The host computer may cancel the TEXT receive by sending a CTRL-C at any time.
  290.  
  291. NewMessagesToMe        27,132
  292. When the host sends this command to the Sender, the Sender should send back a string in the form:  27,132,n,MsgList where n is the number of messages addressed to the User of the Host Computer (5 messages addressed to J.Penner) and MsgList contains the id numbers of the messages.  The MsgList should have One Number per line, and terminate each line with a carriage return (no linefeeds) So, if host would send Towne Crier the string 27,132 after logging on, the Towne Crier would respond with:  27,132,5,124^125^138^141^142^  (where the character ^ represents ascii 13)
  293. meaning there are five messages addressed to J.Penner (which is the name I logged in under) and the numbers of the messages are:  124, 125, 138, 141, and 142.  After this the host will send back and ACK (ascii 6) or if the message didn't get through, the host will send back an NAK (ascii 21), and the Sender will retransmitt it's string of message numbers.  If there are no new messages, n will = 0, and msgList will be "NUL" terminated by a CR.
  294. Then the Sender (bbs, or information service) will just wait for another command, it will transmit no further information!!!
  295.  
  296. NewMessagesToAll    27,133
  297. This is identical to NewMessagesToMe, except the Sender will list out "All" mail, instead of mail addressed to the User.
  298.  
  299. ReadMessageRequest    27,134,msgNumber
  300. - message Number is an ascii string of the number of the message, and is terminated with a CR (ascii 13) and no linefeed should be allowed.  Eg:  for message 563, msgNumber will be: "563^" (the ^ is an ascii 13, and please ignore the quotes)
  301. - When the host sends this to the Sender, the sender will respond with:  27,134,n1,n2,TEXT  where n1 (MSB (most significant byte)) and n2 (LSB (least significant byte)) represent how many characters there are in TEXT.  TEXT of course is the actual message.
  302. - After receiving the message, the host will send an ACK, after which the Sender computer will wait for another command, and send no further information until requested.  If a NAK is received by the Sender, the Sender will retransmitt the message.
  303.  
  304. NewDLFiles        27,135
  305. When the Sender receives this from the host, it will send the string: 27,135,n1,n2,TEXT  the format for n1,n2,TEXT are the same as for the messages, except that the TEXT will be a listing of new files since last logon, instead of a message.
  306.  
  307. DLFile        27,136,n,Name,Protocol
  308. - n is the number of characters in Name
  309. - Name is the filename of the file to be downloaded
  310. - Protocol = 1-Xmodem, =2-XModem CRC, =3-XModem 1K/CRC, =4-YModem, =5-Kermit, =6-ZModem
  311. When the host sends this to the Sender, the sender will respond with 27,136,x  where if x=1 then the file is there, and a file transfer will be initiated, if x=2 then that protocol is not supported, and if x=3 then the file "Name" is not available.
  312.  
  313. ULFile        27,137,n,Name,n2,Description,Protocol,s1,s2,s3,s4
  314. -n in number of chars in Name
  315. -Name is the name of the file
  316. -n2 is the number of chars in Description
  317. -Protocol is the protocol to be used
  318. -s1 (MSB) to s4 (LSB) are the number of bytes to be transfered
  319. The Sender will respond with 27,137,x  if x=1 then a file transfer will be initiated, if x=2 then the name is bad, if x=3 then the description is too long, if x=4 then the selected protocol isn't supported, if x=5 then there isn't enough room on the Senders System to receive the upload.
  320.  
  321. SendMessage    27,138,n,name,n2,subject,n3,n4,TEXT
  322. -n is the number of chars in name
  323. -name is the name of whom you wish to address the message to (make it ALL for all)
  324. -n2 is the number of chars in subject
  325. -subject contains the subject of the message
  326. -n3 (MSB) and n4 (LSB) is the number of characters in the message
  327. -TEXT is the message (may contain CR's to signify the ends of paragraphs)
  328. There should be a 27,138,x from the SENDER after the message is received.  X=1 means everything went fine, X=2 means there was no person by the name of NAME found, X=3 means some other error happened.
  329.  
  330.  
  331.  
  332. And that's it.  If there is demand, we can expand JScript to include more features found on most BBS's, but the commands given here should be enough to get at least the basic BBS operations standardized.  I hereby put the JWindows 1.00 and JScript 1.00 Protocols and all incarnations and forthcoming versions into the public domain, as long as it retains the name JWindows, and JScript.  (J is for John)  If you have any questions or comments on JWindows, or JScript, leave me E-Mail on GEnie at J.PENNER, or call me at (416) 687-3938, or (416) 641-1839, and ask for John Roland.  Or send me mail via my Old Mail Address:
  333.  
  334.     John R.H. Penner,
  335.     431 Queenston Rd. RR4,
  336.     Niagara on the Lake,
  337.     Ontario, Canada, L0S 1J0
  338.  
  339. eof
  340.